<template>
	<view>
		<navNav :navobj="navobj"></navNav>
		
		<scroll-view class="scroll-view" scroll-y="true" refresher-enabled="true"
		 :refresher-triggered="triggered" refresher-background="#fff" 
		 @refresherrefresh="pulldown" @scrolltolower="scrolltolower" >
			<view class="box" v-for="(item,index) in 2">
				<view class="boxon">
					<view class="title">订单号12213123123</view>
					<view v-if="index==0" class="time">等待师傅处理</view>
					<view v-if="index==1" class="time" style="color:#00B578;">评价完成</view>
				</view>
				<view v-if="index==0" style="display: flex;align-items: center;justify-content: space-between;">
					<view class="content">限时30分钟处理</view>
					<uni-countdown :minute="30" :second="0" :show-colon="false" />
				</view>
				<view v-if="index==1" style="display: flex;align-items: center;justify-content: space-between;">
					<view class="content">已完成 2023-4-48 22:18</view>
					<view class="content"></view>
				</view>
				
				<view style="padding-left:40rpx;box-sizing: border-box; display: flex;align-items: center;margin-top: 20rpx; font-weight: 400;font-size: 24rpx;color: rgba(0,0,0,0.6);display: flex;align-items: center; width: 670rpx;height: 114rpx;background: #F9F9F9;border-radius: 0rpx;">
					师傅维修未成功，申请退款
				</view>
				<view style="margin-top: 20rpx;font-weight: 400;font-size: 24rpx;color: rgba(0,0,0,0.4);">反馈时间：2023-4-48 22:18</view>
				
				<view style="display: flex;justify-content: space-between;margin-top: 50rpx;">
					<view style="width: 10rpx;"></view>
					<view style="display: flex;align-items: center;">
						<view style="margin-right: 20rpx; width: 156rpx;height: 54rpx;font-weight: 400;text-align: center;line-height:54rpx;font-size: 24rpx;color: rgba(0,0,0,0.85);border-radius:40rpx;border: 2rpx solid rgba(0,0,0,0.16);">客服介入</view>
						<view style="text-align: center;line-height:54rpx; font-weight: 400;font-size: 24rpx;color: #FFFFFF;width: 156rpx;height: 54rpx;background: #3662EC;border-radius:40rpx;">联系客户</view>
					</view>
					
				</view>
			</view>
			
			
			
		
			<view style="height: 100rpx;"></view>
		</scroll-view>
	</view>
</template>

<script setup>
	import {reactive, ref,getCurrentInstance} from 'vue'
	import {onLoad} from "@dcloudio/uni-app"
	const {proxy} = getCurrentInstance()
  const xingxing = ref(5)
	const navobj = reactive({
		title:'售后管理',
		image:true
	})
	const lists = ref({
		list:[],
		total:0
	})
	const scrollobj = reactive({
		triggered:false,
		pageNum:1,
		pageSize:10,
		isloading:false,
		total:0,
		isjz:false,
		pulldown:false
	})
	//列表请求
	const contentListfun=async()=>{
		return
		scrollobj.isloading = true
		var data = {
			pageNum:scrollobj.pageNum,
			pageSize:scrollobj.pageSize,
			flowStatus:'PENDING_REV',
		}
		const result = await proxy.$api.contentlistAPi(data)
		if(result.code==200){
			console.log('服务订单列表',result);
			scrollobj.isloading = false
			if(result.rows.length>0){
				lists.list = [...lists.list,...result.rows]
			}
			uni.hideLoading()
			lists.total = result.total
		}
	}
	// 下拉刷新
	const pulldown=()=>{
		scrollobj.triggered=true
		scrollobj.pageNum = 1
		lists.list = []
		contentListfun()
	}
	//上拉加载
	const scrolltolower=()=>{
		if (scrollobj.total < 10) {
			proxy.$showToast('没有更多了')
			return
		}
		if (scrollobj.isloading) return;
			scrollobj.pageNum++;
			uni.showLoading({
				title: '加载中'
			});
		// 执行的函数↓
		contentListfun()
	}
</script>

<style lang="scss">
page{
	overflow: hidden;
}
.scroll-view{
		height: 100vh;width: 750rpx;margin: 0 auto;background-color: #f5f5f5;padding-top: 30rpx;
		.box{
			width: 710rpx;margin: 0 auto;background-color: #fff;padding: 30rpx 20rpx;
			box-sizing: border-box;border-radius: 10rpx;margin-bottom: 30rpx;
			.boxon{
				display: flex;align-items: center;justify-content: space-between;
					.title{
						font-weight: 700;font-size: 28rpx;color: rgba(0,0,0,0.85);
					}
					.time{
						font-weight: 700;font-size: 24rpx;color: #3662EC;line-height: 34rpx;
					}
			}
			.content{
				margin-top: 20rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: rgba(0,0,0,0.4);
			}
			
			
		}
	}
</style>
